
#include "api.h"

namespace Pbrt
{
    // API Global Variables
    Options PbrtOptions;

    struct RenderOptions
    {
        // RenderOptions Public Methods
        Integrator* MakeIntegrator() const;
        Scene* MakeScene() const;
        Camera* MakeCamera() const;

        // RenderOptions Public Data
        float transformStartTime = 0, transformEndTime = 1;
        std::string FilterName = "box";
        // ParamSet FilterParams;

        
    };

    // API Static Data
    enum class APIState
    {
        Uninitialized,
        OptionsBlock,
        WorldBlock,
    };
    static APIState currentApiState = APIState::Uninitialized;
    static std::unique_ptr<RenderOptions> renderOptions;

    // API Function Definitions
    void pbrtInit(const Options& opt)
    {
        PbrtOptions = opt;
        // API Initialization
        if(currentApiState != APIState::Uninitialized)
        {
            Error("PbrtInit() has already been called");
        }
        currentApiState = APIState::OptionsBlock;
        renderOptions.reset(new RenderOptions);
        
    }
};